.TH std::error_code 3 "2024.06.10" "http://cppreference.com" "C++ Standard Libary"
.SH NAME
std::error_code \- std::error_code

.SH Synopsis
   Defined in header <system_error>
   class error_code;                 \fI(since C++11)\fP

   std::error_code represents a platform-dependent error code value. Each
   std::error_code object holds an error code value originating from the operating
   system or some low-level interface and a pointer to an object of type
   std::error_category, which corresponds to the said interface. The error code values
   are not required to be unique across different error categories.

.SH Member functions

   constructor             constructs an error code
                           \fI(public member function)\fP
   operator=               assigns another error code
                           \fI(public member function)\fP
   assign                  assigns another error code
                           \fI(public member function)\fP
.SH Modifiers
   clear                   sets the error_code to value 0 in system_category
                           \fI(public member function)\fP
.SH Observers
   value                   obtains the value of the error_code
                           \fI(public member function)\fP
   category                obtains the error_category for this error_code
                           \fI(public member function)\fP
   default_error_condition obtains the error_condition for this error_code
                           \fI(public member function)\fP
   message                 obtains the explanatory string for this error_code
                           \fI(public member function)\fP
   operator bool           checks if the value is non-zero
                           \fI(public member function)\fP

.SH Non-member functions

   operator==
   operator!=
   operator<          compares two error_codes
   operator<=>        \fI(function)\fP
   (removed in C++20)
   (removed in C++20)
   (C++20)
   operator<<         outputs the value and the category name to an output stream
                      \fI(function)\fP

.SH Helper classes

   is_error_code_enum         identifies a class as an error_code enumeration
   \fI(C++11)\fP                    \fI(class template)\fP
   std::hash<std::error_code> hash support for std::error_code
   \fI(C++11)\fP                    \fI(class template specialization)\fP

.SH See also

   error_condition            holds a portable error code
   \fI(C++11)\fP                    \fI(class)\fP
   error_category             base class for error categories
   \fI(C++11)\fP                    \fI(class)\fP
   make_error_code(std::errc) creates error code value for errc enum e
   \fI(C++11)\fP                    \fI(function)\fP
